<template>
  <el-form-item :label="label">
    <div v-for="(item, index) in data" :key="index">
      <el-image
        style="width: 100px; height: 100px"
        :src="item"
        :preview-src-list="data"
      >
        <div slot="placeholder" class="image-slot">
          加载中<span class="dot">...</span>
        </div>
      </el-image>
    </div>
  </el-form-item>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      default: () => ([])
    },
    label: {
      type: String,
      default: () => ''
    }
  }
}

</script>

<style scoped>
.image-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background-color: rgb(246, 247, 250);
}
</style>
